.SUFFIXES: .c .h .o 
TCPR=mips-openwrt-linux-
#TCPR=mipsel-linux-
TCPR=

CC=${TCPR}gcc
LD=${TCPR}ld
AR=${TCPR}ar
STRIP=${TCPR}strip


# CFLAGS=-Os -pedantic -ansi -std=c99   -DCMAKE_BUILD -DNO_READLINE -I. -I ../libuv
# CFLAGS=-Wint-to-pointer-cast -DCMAKE_BUILD -DNO_READLINE  -std=c99 -I. 
CFLAGS=-DCMAKE_BUILD -DNO_READLINE  -std=c99 -I. -g
#CFLAGS=-DCMAKE_BUILD -DNO_READLINE  -I. -I ../libuv
#LDFLAGS = -L ../libuv -luv -lpthread -lrt -lm  
#LDFLAGS = -lm -lrt
#LDFLAGS = -lm -L libwebsockets -lws -lpthread
LDFLAGS = -lm -lrt

OBJECTS=  main.o duktape.o jsnix.o mod_os.o mod_io.o mod_process.o mod_ipc.o
#OBJECTS=  duktape.o mod_os.o mod_io.o mod_fs.o mod_net.o mod_util.o mod_ws.o \
#	sha1.o md5c.o

all:js
js:$(OBJECTS) 
	$(CC)  $^ $(LDFLAGS) -o$@
#	$(STRIP) $@
.c.o:
	$(CC) $(CFLAGS) -c $^

clean:
	rm -f *.o js

